#include<iostream>
#include<cmath>
using namespace std;
const int N = 1e5 + 10;
int st[N];
int n, m;
int main()
{
	cin >> n >> m;
	int pre = 0;
	int ans = 0;
	int ans2 = 0;
	bool flag = 0;
	while (m--) {
		int l, r;
		cin >> l >> r;
		for (int i = l; i <= r; i++) {
			st[i]++;
		}
	}
	bool flag = 0;
	for (int i = 1; i <= n; i++) {
		if (!st[i] || st[i] > 1) {
			ans = i;
			flag = 1;
			break;
		}
	}
	if (!flag) {
		cout << "OK" << endl;
	}
	else {
		cout << ans << " " << st[ans] << endl;
	}
	/*for (int i = 1; i <= m; i++) {
		int l, r;
		cin >> l >> r;
		if (pre < l + 1) {
			pre = r;
			for (int i = l; i <= r; i++) {
				st[i]++;
				if (st[i] > 1) {
					ans = m;
					flag = 1;
					break;
				}
			}
		}
		else if (pre == l) {
			ans = m;
			flag = 1;
			ans2 = 2;
			break;
		}
		else {
			ans = m;
			ans2 = 2;	
			break;
		}
	}
	if (!flag) {
		cout << "OK" << endl;
	}
	else {
		cout << ans << " " << ans2 << endl;
	}*/
	return 0;
}